#import "FableHoverController.h"
        
#import "FableHoverModel.h"
#import "FableHoverCell.h"
#import "Masonry.h"

@interface FableHoverController () <UITableViewDataSource, UITableViewDelegate>

@property (nonatomic, strong) UITableView *kaleidoscopeJeopardyTableView;
@property (nonatomic, strong) NSMutableArray *melancholyMarvelQuestArray;

@end

@implementation FableHoverController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self whimsyInitlyout];
	[self kingdomloadData];
}


//: 获取数据模型
- (void)kingdomloadData {
	
}

//: 懒加载数据模型数组
- (NSMutableArray *)melancholyMarvelQuestArray {
	if (!_melancholyMarvelQuestArray) {
		_melancholyMarvelQuestArray = [NSMutableArray array];
	}
	return _melancholyMarvelQuestArray;
}

- (UITableView *)figHandleTableView {
    if (!_kaleidoscopeJeopardyTableView) {
        _kaleidoscopeJeopardyTableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStylePlain];
        _kaleidoscopeJeopardyTableView.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
        _kaleidoscopeJeopardyTableView.estimatedRowHeight = 0;
        _kaleidoscopeJeopardyTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _kaleidoscopeJeopardyTableView.contentInset = UIEdgeInsetsMake(16, 0, 16, 0);
        _kaleidoscopeJeopardyTableView.delegate = self;
        _kaleidoscopeJeopardyTableView.dataSource = self;
        _kaleidoscopeJeopardyTableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
        _kaleidoscopeJeopardyTableView.showsVerticalScrollIndicator = NO;
        _kaleidoscopeJeopardyTableView.showsHorizontalScrollIndicator = NO;
        _kaleidoscopeJeopardyTableView.backgroundColor = UIColor.clearColor;
    }
    return _kaleidoscopeJeopardyTableView;
}

//: 初始化页面UI
- (void)whimsyInitlyout {

	[self.view addSubview:self.kaleidoscopeJeopardyTableView];
	[self.kaleidoscopeJeopardyTableView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.leading.trailing.equalTo(self.view);
		make.top.equalTo(self.view);
		make.bottom.equalTo(self.view.mas_safeAreaLayoutGuideBottom);
	}];
}


#pragma mark - UITableView DataSource 
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.melancholyMarvelQuestArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    FableHoverCell *odysseyDiligent = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([FableHoverCell class])];
    if (odysseyDiligent == nil) {
        odysseyDiligent = [[FableHoverCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:NSStringFromClass([FableHoverCell class])];
    }
    odysseyDiligent.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return odysseyDiligent;
}


#pragma mark - UITableView Delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // cell tap action
}


@end
